package org.donald.hessian.client;

import java.net.MalformedURLException;

import org.donald.hessian.service.HelloService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.caucho.hessian.client.HessianProxyFactory;

/**
 * @author donald
 * 2018年3月12日
 * 下午5:08:39
 */
public class HessianClientUnderSpring {
	private static final Logger log = LoggerFactory.getLogger(HessianClientUnderSpring.class);
    private static final String DEFAULT_URL = "http://localhost:8080/hessian-demo/helloService";
	public static void main(String[] args) throws MalformedURLException {
		HessianProxyFactory factory = new HessianProxyFactory();
		HelloService helloService = (HelloService) factory.create(HelloService.class, DEFAULT_URL);
		String result = helloService.sayHello("donald");
		log.info("result:{}",result);
	}

}
